package com.baizhi.utils.apache.collections;

import org.apache.commons.collections4.MapUtils;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

public class MapUtilsTest {

    /**
     * 判断是否为空
     */
    @Test
    public void test1() {
        Map<String, String> map = new HashMap<>();
        System.out.println(MapUtils.isEmpty(map));
        System.out.println(MapUtils.isNotEmpty(map));
    }

    @Test
    public void test2() {
        Map<String, String> map = new HashMap<>();
        map.put("a", "100");
        // 获取map中key为a的值，并转成Integer
        System.out.println(MapUtils.getInteger(map, "a"));
    }
}
